package com.xinqi.modules.sys.menu.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.xinqi.common.base.enums.BaseEnum;
import lombok.Getter;

/**
 * 菜单类型，0-目录；1-菜单；2-按钮；3-API
 *
 * @author linkai
 * @date 2023/5/7
 */
public enum MenuTypeEnum implements BaseEnum {
    CATALOG("0", "目录"),
    MENU("1", "菜单"),
    BUTTON("2", "按钮"),
    API("3", "API"),
    ;

    @Getter(onMethod_ = {@JsonValue})
    private final String code;

    @Getter
    private final String describe;

    MenuTypeEnum(String code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @JsonCreator
    public static MenuTypeEnum of(String code) {
        return BaseEnum.of(MenuTypeEnum.class, code);
    }

}
